package com.jonwa.dansRPG.skills;

import org.bukkit.Sound;
import org.bukkit.entity.Player;
import org.bukkit.potion.PotionEffect;
import org.bukkit.potion.PotionEffectType;

public class HealSkill implements Skill {

    @Override
    public String getName() {
        return "Heal";
    }

    @Override
    public int getCooldown() {
        return 10; // 10秒冷却（比火球长）
    }

    @Override
    public void execute(Player caster) {
        // 恢复6颗心
        double health = caster.getHealth() + 12;
        caster.setHealth(Math.min(health, caster.getMaxHealth()));

        // 添加光效
        caster.addPotionEffect(new PotionEffect(PotionEffectType.GLOWING, 100, 1));
        caster.getWorld().playSound(caster.getLocation(), Sound.ENTITY_EXPERIENCE_ORB_PICKUP, 1.0f, 1.0f);

        // 粒子效果（实际开发需使用Particle API）
        caster.sendMessage("§a✨ 生命值已恢复！");
    }
}